home *** CD-ROM | disk | FTP | other *** search
-
-
-
- UUUUSSSSCCCCTTTTLLLLSSSSEEEEMMMMAAAA((((3333PPPP)))) UUUUSSSSCCCCTTTTLLLLSSSSEEEEMMMMAAAA((((3333PPPP))))
-
-
-
- NNNNAAAAMMMMEEEE
- usctlsema - semaphore control operations
-
- CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<uuuulllloooocccckkkkssss....hhhh>>>>
-
- iiiinnnntttt uuuussssccccttttllllsssseeeemmmmaaaa ((((uuuusssseeeemmmmaaaa____tttt ****sssseeeemmmmaaaa,,,, iiiinnnntttt ccccmmmmdddd [[[[,,,, vvvvooooiiiidddd ****aaaarrrrgggg ]]]]))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _u_s_c_t_l_s_e_m_a provides a variety of semaphore control operations as specified
- by _c_m_d. The following _c_m_d_s are available:
-
- CCCCSSSS____MMMMEEEETTTTEEEERRRROOOONNNN Enable metering for the semaphore specified by _s_e_m_a. The
- metering information gathered consists of the number of
- _u_s_p_s_e_m_a and _u_s_c_p_s_e_m_a calls, the number of times the
- semaphore could immediately be acquired, the number of
- _u_s_v_s_e_m_a calls, the number of times _u_s_v_s_e_m_a was called and
- no process was queued waiting, the current number of
- processes waiting on the semaphore, and the maximum number
- of processes ever waiting on the semaphore. All metering
- is stored in a _s_e_m_a_m_e_t_e_r__t structure defined in the header
- file <_u_l_o_c_k_s._h> and described below.
-
- CCCCSSSS____MMMMEEEETTTTEEEERRRROOOOFFFFFFFF Disable metering for the semaphore specified by _s_e_m_a.
-
- CCCCSSSS____MMMMEEEETTTTEEEERRRRFFFFEEEETTTTCCCCHHHH Fills the structure pointed to by _a_r_g with the metering
- data associated with _s_e_m_a.
-
- CCCCSSSS____MMMMEEEETTTTEEEERRRRRRRREEEESSSSEEEETTTT Reinitializes the _s_e_m_a_m_e_t_e_r__t structure associated with
- _s_e_m_a to all 0.
-
- CCCCSSSS____DDDDEEEEBBBBUUUUGGGGOOOONNNN Enable debug monitoring for the semaphore specified by
- _s_e_m_a. The debugging information maintained consists of
- the process id of the owner of the semaphore, and the
- address in the owner process where the call to the
- semaphore operation was made, the process id of the last
- process to operate on the semaphore, and the address in
- the last process where the call to the semaphore operation
- was made. The pid is set to -1 if no one owns the
- semaphore. All debug info is stored in a _s_e_m_a_d_e_b_u_g__t
- structure defined in the header file <_u_l_o_c_k_s._h> and
- described below.
-
- CCCCSSSS____DDDDEEEEBBBBUUUUGGGGOOOOFFFFFFFF Disable debugging for the semaphore specified by _s_e_m_a.
-
- CCCCSSSS____DDDDEEEEBBBBUUUUGGGGFFFFEEEETTTTCCCCHHHH Fills the structure pointed to by _a_r_g with the debugging
- data associated with _s_e_m_a.
-
- CCCCSSSS____DDDDEEEEBBBBUUUUGGGGRRRREEEESSSSEEEETTTT Reinitializes the elements of the _s_e_m_a_d_e_b_u_g__t structure
- associated with _s_e_m_a to values of -1.
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- UUUUSSSSCCCCTTTTLLLLSSSSEEEEMMMMAAAA((((3333PPPP)))) UUUUSSSSCCCCTTTTLLLLSSSSEEEEMMMMAAAA((((3333PPPP))))
-
-
-
- CCCCSSSS____HHHHIIIISSSSTTTTOOOONNNN Enable history logging for the semaphore specified by
- _s_e_m_a. A global history is maintained that consists of a
- record of each transaction on semaphores in hhhhiiiisssstttt____tttt
- structures defined in the header file <_u_l_o_c_k_s._h>. This is
- discussed further in _u_s_c_o_n_f_i_g(3P), which is used to
- retrieve history of semaphore transactions.
-
- CCCCSSSS____HHHHIIIISSSSTTTTOOOOFFFFFFFF Disable history for the semaphore specified by _s_e_m_a.
-
- CCCCSSSS____RRRREEEECCCCUUUURRRRSSSSIIIIVVVVEEEEOOOONNNN Enables recursive acquires of the semaphore specified by
- _s_e_m_a. Normally, an attempt to recursively acquire a
- mutual exclusion semaphore, (one initialized with a value
- of 1), will result in the calling process deadlocking.
- This option will cause a count to be incremented each time
- the current owner acquires the semaphore (including
- _u_s_c_p_s_e_m_a(3P)). A matched number of _u_s_v_s_e_m_a(3P) calls will
- release the semaphore. This option can be used only with
- mutual exclusion semaphores and must be specified when the
- semaphore is currently free. Note that the recursive
- semaphore option is _nnnn_oooo_tttt _ssss_uuuu_pppp_pppp_oooo_rrrr_tttt_eeee_dddd for pthread applications
- intending to share the semaphore across process
- boundaries. However, pthread application threads may use
- recursive semaphores when semaphore access is restricted
- to a single process.
-
- CCCCSSSS____RRRREEEECCCCUUUURRRRSSSSIIIIVVVVEEEEOOOOFFFFFFFF
- Disable recursive acquires of the semaphore specified by
- _s_e_m_a.
-
- Declarations of the function and _c_m_d_s, the hhhhiiiisssstttt____tttt structure, the
- sssseeeemmmmaaaammmmeeeetttteeeerrrr____tttt structure, and the sssseeeemmmmaaaaddddeeeebbbbuuuugggg____tttt structure, are in the
- <_u_l_o_c_k_s._h> header file.
-
- The structure declaration of sssseeeemmmmaaaammmmeeeetttteeeerrrr____tttt is:
-
- typedef struct semameter_s {
- int sm_phits; /* number of immediate psemas*/
- int sm_psemas; /* number of psema attempts */
- int sm_vsemas; /* number of vsema attempts */
- int sm_vnowait; /* number of vsemas with no one
- waiting */
- int sm_nwait; /* number of threads waiting on the
- semaphore */
- int sm_maxnwait; /* maximum number of threads waiting
- on the semaphore */
- } semameter_t;
-
- The structure declaration of sssseeeemmmmaaaaddddeeeebbbbuuuugggg____tttt is:
-
- typedef struct semadebug_s {
- int sd_owner_pid /* the process that owns the semaphore */
- char * sd_owner_pc; /* the address of last psema for
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- UUUUSSSSCCCCTTTTLLLLSSSSEEEEMMMMAAAA((((3333PPPP)))) UUUUSSSSCCCCTTTTLLLLSSSSEEEEMMMMAAAA((((3333PPPP))))
-
-
-
- process that owns the semaphore */
- int sd_last_pid; /* the process that last did a p or v sema */
- char * sd_last_pc; /* the address of the last routine to operate
- on the semaphore */
- } semadebug_t;
-
- _u_s_c_t_l_s_e_m_a will fail if one or more of the following are true:
-
- [EINVAL] _c_m_d is not a valid command.
-
- [EINVAL] _c_m_d is equal to CCCCSSSS____MMMMEEEETTTTEEEERRRRFFFFEEEETTTTCCCCHHHH and metering in not
- currently enabled.
-
- [EINVAL] _c_m_d is equal to CCCCSSSS____DDDDEEEEBBBBUUUUGGGGFFFFEEEETTTTCCCCHHHH and debugging is not
- currently enabled.
-
- [ENOMEM] _c_m_d is equal to CCCCSSSS____MMMMEEEETTTTEEEERRRROOOONNNN or CCCCSSSS____DDDDEEEEBBBBUUUUGGGGOOOONNNN and there was not
- enough memory in the arena.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- usconfig(3P), uscpsema(3P), usdumpsema(3P), usinitsema(3P),
- usnewsema(3P), uspsema(3P), usvsema(3P).
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- Upon successful completion, a value of 0 is returned. Otherwise, a value
- of -1 is returned and _e_r_r_n_o is set to indicate the error.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-